<template>
	<view>
		<view class="topJi">
			<image class="bgTop" :src="jiData.logo" mode=""></image>
			<view class="bgTop bgtops"></view>
			<view class="models"></view>
			<view class="contentUser p30">
				<image class="userImg " :src="jiData.logo"></image>
				<view class="text">
					<p class="p1">
						#{{jiData.name}}#
					</p>
					<p class="p2">
						 {{jiData.introduce}}
					</p>
					<p class="p3">
						  {{jiData.productQuantity}} 件商品
						|
						 {{jiData.hits}} 次浏览
					</p>
				</view>	
			</view>
		</view>
		<goodsData ref="goodsDatas" :url="url" :id="id"  ></goodsData> 
	</view>
</template>
<script>
	import {MarketsDetail,marketmarketProductsUrl} from '../../api/api.js'
	import waterfall from '@/components/waterfall/waterfall.vue'
	export default {
		components:{waterfall},
		data() {
			return {
				url:marketmarketProductsUrl,
				id:0,
				pageNumber:1,
				pageSize:10,
				stops:0,
				jiData:[],
				goodsList:[]
			}
		},
		onLoad(e) {
			this.id = e.id
			this.init()   
		},
		onReachBottom() {
			this.$refs['goodsDatas'].checking()
		},
		mounted() {
			this.$refs['goodsDatas'].init() 
			
		},
		methods: {
			async init(){
				let parameter ={
					id:this.id,
					pageable:{
						pageNumber:this.pageNumber,
						pageSize:this.pageSize
					},
					longitude:this.$store.state.longitude,
					latitude:this.$store.state.latitude
				}
				let jiData = await MarketsDetail({id:this.id})
				 this.jiData = jiData.data  
				 uni.setNavigationBarTitle({
				 	title:this.jiData.name
				 })
			}
		}
	}
</script>

<style lang="less" scoped>
@import 'index.less';
</style>
